load(":buildbuddy.bzl", "buildbuddy")
load(":local.bzl", "local")

oncall("build_infra")

host_cpu = "prelude//cpu:" + (
    "arm64" if host_info().arch.is_aarch64 else "riscv64" if host_info().arch.is_riscv64 else "x86_64"
)

host_os = "prelude//os:" + ("macos" if host_info().os.is_macos else "linux")

buildbuddy(
    name = "buildbuddy",
    cpu_configuration = host_cpu,
    os_configuration = host_os,
    use_persistent_workers = False,
)

buildbuddy(
    name = "buildbuddy-persistent-workers",
    cpu_configuration = host_cpu,
    os_configuration = host_os,
    use_persistent_workers = True,
)

local(
    name = "local",
    cpu_configuration = host_cpu,
    os_configuration = host_os,
    use_persistent_workers = False,
)

local(
    name = "local-persistent-workers",
    cpu_configuration = host_cpu,
    os_configuration = host_os,
    use_persistent_workers = True,
)
